
import Vue from 'vue'
const SUCCESS = 1000000
const API_ROOT = server.root + '/newmanage'

const behaviorListResource = Vue.resource(API_ROOT + '/behavior/list')
export const exportBehaviorResource = API_ROOT + '/behavior/export'

export const getBehaviorList = ({dispatch}) => {
  return behaviorListResource.get({
    start: 0,
    limit: 30
  })
    .then((res) => {
      if (+res.data.code === SUCCESS) {
        return Promise.resolve(res.data.data)
      }
      return Promise.reject(res.data)
    })
}
